package com.community.web.master.controller;


import com.community.common.result.Result;
import com.community.model.entity.ChargeDetail;
import com.community.web.master.domain.dto.PageChargeDto;
import com.community.web.master.domain.dto.PageParkingDto;
import com.community.web.master.domain.vo.ChargeDetailVo;
import com.community.web.master.domain.vo.PageResult;
import com.community.web.master.service.IChargeDetailService;
import com.community.web.master.service.IChargeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 李晶
 * @since 2024-07-02
 */
@RestController
@RequestMapping("/master/charge")
@Slf4j
@Api(tags = "缴纳接口")
public class ChargeController {
    @Autowired
    IChargeService iChargeService;
    @GetMapping("/pageQuery")
    @ApiOperation("缴费分页查询")
    public Result<PageResult> pageQuery(PageChargeDto pageChargeDto){
        log.info("缴费分页查询:"+ pageChargeDto);
         PageResult pageResult =iChargeService.pageQuery(pageChargeDto);
        return Result.success(pageResult);
    }

    @GetMapping
    @ApiOperation("根据账单编号查询账单详情")
    public Result<List<ChargeDetail>> getDetailListByChargeNo(String chargeNo){
        log.info("根据账单编号查询账单详情"+chargeNo);
        List<ChargeDetail> result = iChargeService.getDetailListByChargeNo(chargeNo);
        return Result.success(result);
    }

}
